<?php
namespace app\index\model;

use think\Db;
use think\Model;

class Ci extends Model{
    protected $autoWriteTimestamp=true;
    protected $createTime='logintime';



    public static function cha($data){
        $a=self::whereTime('logintime','d')->where('username',$data)->order('logintime desc')->limit(0,5)->buildSql(true);
        $user=Db::table($a.'a')->where('cishu','1')->count();
        return $user;
    }

    public function add($date=[]){
       $rt= $this->allowField(true)->save($date);
       return $rt;
    }






}
